<!-- #header -->
<header id="header">
  <div class="container clearfix">
    <?php if ($logo): ?>
      <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home" id="logo">
        <img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" />
      </a>
    <?php endif; ?>

    <?php if ($site_name || $site_slogan): ?>
      <div id="name-and-slogan"<?php if ($hide_site_name && $hide_site_slogan) { print ' class="element-invisible"'; } ?>>

        <?php if ($site_name): ?>
          <?php if ($title): ?>
            <div id="site-name"<?php if ($hide_site_name) { print ' class="element-invisible"'; } ?>>
              <strong>
                <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><span><?php print $site_name; ?></span></a>
              </strong>
            </div>
          <?php else: /* Use h1 when the content title is empty */ ?>
            <h1 id="site-name"<?php if ($hide_site_name) { print ' class="element-invisible"'; } ?>>
              <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><span><?php print $site_name; ?></span></a>
            </h1>
          <?php endif; ?>
        <?php endif; ?>

        <?php if ($site_slogan): ?>
          <div id="site-slogan"<?php if ($hide_site_slogan) { print ' class="element-invisible"'; } ?>>
            <?php print $site_slogan; ?>
          </div>
        <?php endif; ?>

      </div> <!-- /#name-and-slogan -->
    <?php endif; ?>

    <?php print render($page['header']); ?>
  </div>
</header>
<!-- EOF: #header -->
<!-- #navigation -->
<nav id="navigation">
  <div class="container clearfix">
    <?php print drupal_render($page['navigation']); ?>
  </div>
</nav>
<!-- EOF: #navigation -->
<!-- #content -->
<div id="content">
  <div class="container clearfix">
    <?php if ($page['sidebar_first']) :?>
      <!-- #sidebar-first -->
      <div id="sidebar-first" class="grid_4">
        <?php print render($page['sidebar_first']); ?>
      </div><!-- EOF: #sidebar-first -->
    <?php endif; ?>
    <div id="main">
      <?php if (theme_get_setting('breadcrumb_display','mngt')): print $breadcrumb; endif; ?>

      <?php if ($page['highlighted']): ?><div id="highlighted"><?php print render($page['highlighted']); ?></div><?php endif; ?>

      <?php if ($messages): ?>
        <div id="console" class="clearfix">
          <?php print $messages; ?>
        </div>
      <?php endif; ?>

      <?php if ($page['help']): ?>
        <div id="help">
          <?php print render($page['help']); ?>
        </div>
      <?php endif; ?>

      <?php if ($action_links): ?>
        <ul class="action-links">
          <?php print render($action_links); ?>
        </ul>
      <?php endif; ?>

      <?php print render($title_prefix); ?>
      <?php if ($title): ?>
        <h1><?php print $title ?></h1>
      <?php endif; ?>
      <?php print render($title_suffix); ?>

      <?php if ($tabs): ?><?php print render($tabs); ?><?php endif; ?>

      <?php print render($page['content']); ?>

      <?php print $feed_icons; ?>
    </div>
    <?php if ($page['sidebar_second']) :?>
      <!-- #sidebar-second -->
      <div id="sidebar-second" class="grid_4">
        <?php print render($page['sidebar_second']); ?>
      </div><!-- EOF: #sidebar-second -->
    <?php endif; ?>
  </div>
</div>
<!-- EOF: #content -->
<?php if ($page['footer']) :?>
<!-- #footer -->
<footer id="footer">
  <div class="container clearfix">
    <?php print drupal_render($page['footer']); ?>
  </div>
</footer>
<!-- EOF: #footer -->
<?php endif; ?>